<?xml version="1.0" encoding="UTF-8" ?>
<%@page import="javax.servlet.jsp.jstl.fmt.LocalizationContext"%>
<%@page import="java.util.ResourceBundle"%>
<%@page import="java.util.Calendar"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@ page import="org.jakim.entity.*"%>
<%@ page import="org.jakim.utils.*"%>
<%@page import="org.apache.taglibs.standard.tlv.JstlCoreTLV"%>
<%@page import="org.apache.taglibs.standard.tlv.JstlFmtTLV"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<fmt:setLocale value="en" />
<fmt:setBundle basename="org.jakim.messages.messages" var="msg"
	scope="session" />
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>
<link href="../styles/main.css" rel="stylesheet" type="text/css" />
<link href="../styles/wizard.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
<script type="text/javascript">

$(function() {
    $( "#modalForm" ).dialog({
		autoOpen: false,
		title: 'Dialog Title',
		height: 'auto',
		width: 'auto',
		modal: true,
		show: {
        effect: "blind",
        duration: 1000
      },
      hide: {
        effect: "explode",
        duration: 1000
      }
    });
 
    $( "#addButton" ).click(function() {
      $( "#modalForm" ).dialog( "open" );
    });
  });
  
</script>
</head>
<body>
	<%
	HttpSession httpSeesion = request.getSession();
	List<Education> listEducationAndSkills = null;
	
	Object objEducationAndSkills = httpSeesion.getAttribute("attrEducationAndSkills");
	
	if (objEducationAndSkills != null && objEducationAndSkills instanceof List<?>){
			listEducationAndSkills = (List<Education>) objEducationAndSkills;
	}
%>
	<div id="divBodyContainer">
		<h1>
			<fmt:message key="EDUCATIONANDTRAINING.HEADER" />
		</h1>

		<p>
			<fmt:message key="EDUCATIONANDTRAINING.SUMMARY" />
		</p>

		<button id="addButton">
			<fmt:message key="EDUCATIONANDTRAINING.ADDEDUCATION.BUTTON" />
		</button>

		<div class="wizardHistoryBody">
			<%
	   			if (listEducationAndSkills != null && listEducationAndSkills.size() > 0){
	   				%>
			<table id="addedEducationTable" class="userEntriesTable">
				<tr>
					<th><fmt:message
							key="EDUCATIONANDTRAINING.EDUCATION.TABLE.HEADER.LABEL" /></th>
				</tr>
				<% 
		   			for(Education education: listEducationAndSkills){
		   				%>
				<tr class="EducationDate">
					<td colspan="2"><br /></td>
				</tr>

				<tr class="EducationDate">
					<td class="userEntriesTableParam"><fmt:message
							key="EDUCATIONANDTRAINING.EDUCATION.TABLE.DATES.LABEL" />:</td>
					<td class="userEntriesTableValue"><%=education.getHTMLDates() %>
					</td>
				</tr>

				<tr class="EducationQualificationTitle">
					<td class="userEntriesTableParam"><fmt:message
							key="EDUCATIONANDTRAINING.EDUCATION.TABLE.QUALIFICATION.LABEL" />:
					</td>
					<td class="userEntriesTableValue"><%=education.getEducationQualificationTitle() %>
					</td>
				</tr>

				<tr class="EducationSubjectAndSkills">
					<td class="userEntriesTableParam"><fmt:message
							key="EDUCATIONANDTRAINING.EDUCATION.TABLE.SUBJECTSANDSKILLS.LABEL" />:
					</td>
					<td class="userEntriesTableValue"><%=education.getEducationOccupationalSkills() %>
					</td>
				</tr>
				
				<tr class="EducationClassificationLevel">
					<td class="userEntriesTableParam"><fmt:message
							key="EDUCATIONANDTRAINING.EDUCATION.TABLE.ORGANIZATION.CLASSIFICATIONLEVEL.LABEL" />:
					</td>
					<td class="userEntriesTableValue"><%=education.getEducationClassificationLevel() %>
					</td>
				</tr>

				<tr class="EducationOrganizationName">
					<td class="userEntriesTableParam"><fmt:message
							key="EDUCATIONANDTRAINING.EDUCATION.TABLE.ORGANIZATION.NAME.LABEL" />:
					</td>
					<td class="userEntriesTableValue"><%=education.getEducationOrganisationName() %>
					</td>
				</tr>
				

				<tr class="EducationOrganizationType">
					<td class="userEntriesTableParam"><fmt:message
							key="EDUCATIONANDTRAINING.EDUCATION.TABLE.ORGANIZATION.TYPE.LABEL" />:
					</td>
					<td class="userEntriesTableValue"><%=education.getEducationOrganisationType()%>
					</td>
				</tr>

				<tr class="EducationOrganizationStreet">
					<td class="userEntriesTableParam"><fmt:message
							key="EDUCATIONANDTRAINING.EDUCATION.TABLE.ORGANIZATION.STREET.LABEL" />:
					</td>
					<td class="userEntriesTableValue"><%=education.getEducationStreet() %>
					</td>
				</tr>

				<tr class="EducationOrganizationCity">
					<td class="userEntriesTableParam"><fmt:message
							key="EDUCATIONANDTRAINING.EDUCATION.TABLE.ORGANIZATION.CITY.LABEL" />:
					</td>
					<td class="userEntriesTableValue"><%=education.getEducationCity() %>
					</td>
				</tr>

				<tr class="EducationOrganizationPostalCode">
					<td class="userEntriesTableParam"><fmt:message
							key="EDUCATIONANDTRAINING.EDUCATION.TABLE.ORGANIZATION.POSTCODE.LABEL" />:
					</td>
					<td class="userEntriesTableValue"><%=education.getEducationPostalCode() %>
					</td>
				</tr>

				<tr class="EducationOrganizationCountry">
					<td class="userEntriesTableParam"><fmt:message
							key="EDUCATIONANDTRAINING.EDUCATION.TABLE.ORGANIZATION.FIELD.LABEL" />:
					</td>
					<td class="userEntriesTableValue"><%=education.getEducationCountry() %>
					</td>
				</tr>

				<tr class="EducationOrganizationClassificationLevel">
					<td class="userEntriesTableParam"><fmt:message
							key="EDUCATIONANDTRAINING.EDUCATION.TABLE.CLASSIFICATIONLEVEL.LABEL" />:
					</td>
					<td class="userEntriesTableValue"><%=education.getEducationClassificationLevel() %>
					</td>
				</tr>
				<%
		   			}
	   				%>
			</table>
			<%
   				}
	   		%>
		</div>
		<div id="modalForm">
			<form id="formEducation" class="formExperience" action="../addinfo" method="post">
				<fieldset id="fsetEducation" class="fsetWizard">
					<legend>
						<fmt:message key="EDUCATIONANDTRAINING.FORM.LABEL" />:
					</legend>
					
					<div>
						<label id="lblFromDate" for="dateFromDate">
							<fmt:message key="EDUCATIONANDTRAINING.FORM.DATES.LABEL" />:
						</label>
						<input type="date" id="dateFromDate" name="educationStartDate" />
					</div>
					
					<div>
						<label id="lblEndDate" for="dateEndDate"> 
							<fmt:message key="EDUCATIONANDTRAINING.FORM.DATES.TO.MONTH.LABEL" />:
						</label>						
						<input type="date" id="dateEndDate" name="educationEndDate" />
					</div>
					
					<div id="divQualification">
						<label id="lblQualification" for="txtQualification"> 
							<fmt:message key="EDUCATIONANDTRAINING.FORM.QUALIFICATIONTITLE.LABEL" />:
						</label> 
						<input type="text" id="txtQualification" name="educationQualificationTitle" maxlength="50" />
					</div>

					<div id="divCoveredSkills">
						<label id="lblCoveredSkills" for="txtCoveredSkills"> 
							<fmt:message key="EDUCATIONANDTRAINING.FORM.SUBJECTS.LABEL" />:
						</label>
						<textarea id="txtCoveredSkills" name="educationCoveredSkills" rows="8" cols="20"></textarea>
					</div>

					<label id="lblUnderstanding" class="WizardSection">
						<fmt:message key="EDUCATIONANDTRAINING.FORM.ORGANISATION.SPECIFICS.LABEL" />:
					</label>
					
					<div id="divOrganisationName">
						<label id="lblOrganisationName" for="txtOrganisationName">
							<fmt:message key="EDUCATIONANDTRAINING.FORM.ORGANIZATION.NAME.LABEL" />:
						</label> 
						<input type="text" id="txtOrganisationName" name="educationOrganisationName" maxlength="35" />
					</div>

					<div id="divOrganisationType">
						<label id="lblOrganisationType" for="txtOrganisationType">
							<fmt:message key="EDUCATIONANDTRAINING.FORM.ORGANIZATION.TYPE.LABEL" />:
						</label> 
						<input type="text" id="txtOrganisationType" name="educationOrganisationType" maxlength="35" />
					</div>

					<div id="divOrganisationStreet">
						<label id="lblOrganisationStreet" for="txtOrganisationStreet">
							<fmt:message key="EDUCATIONANDTRAINING.FORM.ORGANIZATION.STREET.LABEL" />:
						</label> 
						<input type="text" id="txtOrganisationStreet" name="educationOrganisationStreet" maxlength="50" />
					</div>

					<div id="divOrganisationCity">
						<label id="lblOrganisationCity" for="txtOrganisationCity">
							<fmt:message key="EDUCATIONANDTRAINING.FORM.ORGANIZATION.CITY.LABEL" />:
						</label> 
						<input type="text" id="txtOrganisationCity" name="educationOrganisationCity" maxlength="35" />
					</div>

					<div id="divOrganisationPostalCode">
						<label id="lblOrganisationPostalCode" for="txtOrganisationPostalCode">
							<fmt:message key="EDUCATIONANDTRAINING.FORM.ORGANIZATION.POSTCODE.LABEL" />:
						</label> 
						<input type="text" id="txtOrganisationPostalCode" name="educationOrganisationPostalCode" maxlength="5" />
					</div>

					<div id="divOrganisationCountry">
						<label id="lblOrganisationCountry" for="txtOrganisationCountry">
							<fmt:message key="EDUCATIONANDTRAINING.FORM.ORGANIZATION.COUNTY.LABEL" />:
						</label> 
						<input type="text" id="txtOrganisationCountry" name="educationOrganisationCountry" maxlength="35" />
					</div>

					<div id="divClassificationLevel">
						<label id="lblClassificationLevel" for="txtClassificationLevel">
							<fmt:message key="EDUCATIONANDTRAINING.FORM.CLASSIFICATIONLEVEL.LABEL" />:
						</label> 
						<input type="text" id="txtClassificationLevel" name="educationClassificationLevel" maxlength="35" />
					</div>
					<br />
					<div id="divEducationField">
						<label id="lblEducationField" for="txtEducationField"> 
							<fmt:message key="EDUCATIONANDTRAINING.FORM.ORGANIZATION.FIELD.LABEL" />:
						</label> 
						<input type="text" id="txtEducationField" name="educationField" maxlength="35" />
					</div>

				</fieldset>

				<input type="hidden" value="2" name="numberCVWizardStep" />

				<button type="submit">
					<fmt:message key="SUBMIT.BUTTON" />
				</button>
			</form>

		</div>
		<button id="next"
			onclick="window.location.href = 'personalskillswizard.jsp'">
			<fmt:message key="NEXT.BUTTON" />
		</button>
	</div>
</body>
</html>